package text111;

public class Solution48 {
    public int[] singleNumbers(int[] nums) {
    	int sum = 0;
        int[] res = new int[2];
        for(int num : nums){
           // System.out.print( Integer.toBinaryString(sum)+"sum");     
          //  System.out.print( Integer.toBinaryString(num)+"num");     
            sum ^= num;
         //  System.out.println( Integer.toBinaryString(sum)+"sum");  
        }
        //Integer.toBinaryString(sum);
      //s  System.out.println(sum);
        int m = 1;
        while((m&sum)==0)
        	m<<=1;     	
        for(int num : nums){
        	
            if((num & m) == 0){
                res[0] ^= num;
            }else{
                res[1] ^= num;
            }
        }
        return res;
    }
}
